;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var dialog = require("dialog");
	var router = require("../hash/pageRouter");
	var databind = require("databind");
	var css_riskWarning = require("./auditWarning.css");
	var html_auditWarning = require("./html_auditWarning.html");
	var oData = {
		pageIndex: 1,
		pageSize: 1000, 
		totalPageCount: 1, 
		totalRecordCount: 0
	}
	var tools = require("tools");
	var init = function() {
		initEvent();
		router.init();
	};
	
	var initEvent = function() {
		// 若未登录，则返回登陆页面
		if (base.getData("sid") == null || base.getData("sid") == ""|| base.getData("sid") == undefined) {
			top.location.href = "../login/login.html";
		}
		
		tools.loadList("inquireAuditWarningPageList.json", $("#auditWarningTable"), $("#auditWarningTpl"), oData, function(){
			//修改
			$("#auditWarning .update").unbind("click").click(function() {
				var $this = $(this);
				$("#popdialog").html(html_auditWarning);
				databind.fillInput($("#auditWarning_dialog"), {action: "inquireAuditWarning.json?auditWarningId=" + $this.parents("tr").attr("auditWarningId")});
				
				dialog.showDialog($("#auditWarning_dialog"));
				$("#auditWarning_dialog .dialogHandlerBtn").unbind("click").click(function(){
					databind.submitDom($("#auditWarning_dialog"), function(){
						base.alert(1, "修改成功！");
						dialog.hideDialog($("#auditWarning_dialog"));
						router.route("auditWarning/auditWarning.html");
					});
				});
			});
		});
	};
	
	return {
		init : init
	};
});